<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />

<title>Department Home</title>

<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="lib/fxsupport.js"></script>
<script type="text/javascript" src="lib/jquery-1.8.3.js"></script>
<script type="text/javascript" src="lib/JSResource.js"></script>
<script type="text/javascript" src="lib/urlpara.js"></script>

</head>

<body>
	<div class="container">
		<div class="header">
			<a href="#"><img src="logo.jpg" alt="在此处插入徽标" name="Insert_logo"
				width="20%" height="90" id="Insert_logo"
				style="background-color: #8090AB; display:block;" /> </a>
			<!-- end .header -->
		</div>
		<div class="sidebar1">
			<ul class="nav">
				<li><a href="home.jsp">Department Home</a></li>
				<li><a href="contributorlist.htm">Contributor List</a></li>
				<li><a href="memberlist.htm">Member List</a></li>
			</ul>
			<!-- end .sidebar1 -->
		</div>
		<div class="content">
			<p class="report">
				<html:link action="/report" target="_blank">get report</html:link>
			</p>
			<h1>Department Home</h1>
			<h4>Members</h4>
			<p id="members">&nbsp;</p>
			<h4>Projects</h4>
			<table id="projects" width="95%" border="1" align="center"
				cellpadding="0" cellspacing="0">
				<tr>
					<th scope="col">id</th>
					<th scope="col">name</th>
					<th scope="col">start</th>
					<th scope="col">end</th>
					<th scope="col">operation</th>
				</tr>
				<tr>
					<td colspan="5" align="right" scope="col"><a
						href="addProject.htm">add</a></td>
				</tr>
			</table>
			<!-- end .content -->
		</div>
		<div class="footer">
			<!-- end .footer -->
		</div>
		<!-- end .container -->
	</div>
	<script type="text/javascript">
		resource
				.GET(
						"contract/member/*",
						function() {
							for ( var i = 0; i < resource.getChildren().length; i++) {
								if (resource.getChildren()[i]
										.getColumnValue("name") != "demo") {
									document.getElementById("members").innerHTML = document
											.getElementById("members").innerHTML
											+ resource.getChildren()[i]
													.getColumnValue("name")
											+ " ";
								}
							}
						});
		resource.GET("contract/project/*", function() {
			for ( var i = resource.getChildren().length - 1; i >= 0; i--) {
				var project = resource.getChildren()[i];
				if (project.getColumnValue("name") != "demo") {
					var row = document.getElementById("projects").insertRow(1);
					var projectId = project.getColumnValue("primarykey");
					row.align = "center";
					row.innerHTML = "<td><a href=\"project.htm?id=" + projectId
							+ "\">" + projectId
							+ "</a></td><td><a href=\"project.htm?id="
							+ projectId + "\">"
							+ project.getColumnValue("name") + "</a></td><td>"
							+ project.getColumnValue("start") + "</td><td>"
							+ project.getColumnValue("end")
							+ "</td><td><a href=\"addProject.htm?id="
							+ projectId + "\">edit</a></td>";
				}
			}
		});
	</script>
</body>
</html:html>
